<template>
  <div class="page-container" v-global-loading="loading">
    <div class="page-card-container">
      <a-tabs v-model:activeKey="pageSet.refundStatus" @change="changeTab">
        <a-tab-pane :key="7" tab="申请中的售后订单"> </a-tab-pane>
        <a-tab-pane :key="8" tab="审核通过的售后订单"> </a-tab-pane>
        <a-tab-pane :key="11" tab="审核驳回的售后订单"> </a-tab-pane>
        <a-tab-pane :key="9" tab="已关闭的售后订单"> </a-tab-pane>
      </a-tabs>
      <a-form :model="pageSet" layout="inline">
        <a-form-item label="订单编号">
          <a-input
            v-model:value="pageSet.refundCodeSN"
            style="width: 170px"
            :allowClear="true"
          ></a-input>
        </a-form-item>
        <a-form-item label="用户姓名">
          <a-input
            v-model:value="pageSet.memberName"
            style="width: 170px"
            :allowClear="true"
          ></a-input>
        </a-form-item>
        <a-form-item label="订单状态">
          <a-select
            v-model:value="pageSet.strdata"
            style="width: 230px"
            :filter-option="filterOption"
            show-search
          >
            <a-select-option
              :value="item.value"
              :title="item.label"
              v-for="item in orderStatus"
              >{{ item.label }}</a-select-option
            >
          </a-select>
        </a-form-item>
        <a-form-item label="申请时间">
          <a-range-picker
            v-model:value="pageSet.applyStatuDate"
            value-format="YYYY-MM-DD"
            format="YYYY-MM-DD"
            @change="changePicker"
          />
        </a-form-item>
        <a-form-item label="">
          <div class="commonBtn-warning" @click="loadPagination(true)">
            查询
          </div>
        </a-form-item>
        <a-form-item label="">
          <div class="commonBtn-primary" @click="reset">重置</div>
        </a-form-item>
        <!-- <a-form-item label="">
          <div class="commonBtn-primary" @click="exportDerive">订单导出</div>
        </a-form-item> -->
      </a-form>
      <a-table
        size="small"
        :loading="tableLoading"
        :dataSource="tableData"
        :columns="columns"
        bordered
        :pagination="false"
        :scroll="{
          x: 1200,
          y: useAppStore.pageCommonInfo.canUseHeight - 36 + 'px'
        }"
      >
        <template #bodyCell="{text, record, index, column}">
          <template v-if="column.title == '操作'">
            <span class="pointer c-primaryColor" @click="operation(1, record)"
              >查看</span
            >
            <span
              class="pointer c-primaryColor"
              @click="operation(2, record)"
              v-if="pageSet.refundStatus == 7"
              >&nbsp;&nbsp;审核</span
            >
            <span class="pointer c-primaryColor" @click="operation(3, record)"
              >&nbsp;&nbsp;商品信息</span
            >
          </template>
          <template v-if="column.title == '图片信息'">
            <div
              class="pointer"
              v-if="text"
              @click="
                () => {
                  setVisible(true, index);
                }
              "
            >
              <img :src="text" alt="" style="height: 30px" />
              <a-image
                :width="0"
                :style="{display: 'none'}"
                :preview="{
                  visible: visibleImg[index],
                  onVisibleChange: (e) => {
                    setVisible(e, index);
                  }
                }"
                :src="text"
              />
            </div>
          </template>
        </template>
      </a-table>
      <Pagination
        :pageSet="pageSet"
        style="margin-top: 10px"
        :loadPagination="loadPagination"
      ></Pagination>
      <!-- 详情 -->
      <a-modal
        v-model:open="visible"
        width="800px"
        title=""
        :footer="null"
        :maskClosable="false"
      >
        <div style="font-size: 18px; font-weight: 700; margin: 10px 0px">
          订单信息
        </div>
        <a-form :model="form" ref="formRef" :labelCol="{span: 8}">
          <a-row :gutter="24">
            <a-col :span="12">
              <a-form-item label="用户名称" name="createdUserName">
                <a-input v-model:value="form.createdUserName" />
              </a-form-item>
              <a-form-item label="退款订单编号" name="refundCodeSN">
                <a-input v-model:value="form.refundCodeSN" />
              </a-form-item>
              <a-form-item label="订单总金额" name="amount">
                <a-input v-model:value="form.amount" />
              </a-form-item>
              <a-form-item label="税额" name="tax">
                <a-input v-model:value="form.tax" />
              </a-form-item>
              <a-form-item label="退款商品总数量" name="num">
                <a-input v-model:value="form.num" />
              </a-form-item>
              <a-form-item label="退款总金额" name="refundAmount">
                <a-input v-model:value="form.refundAmount" />
              </a-form-item>
              <a-form-item label="订单优惠金额" name="discountAmount">
                <a-input v-model:value="form.discountAmount" />
              </a-form-item>
              <a-form-item label="商品售后状态" name="refundStatus">
                <a-select
                  v-model:value="form.refundStatus"
                  style="width: 240px"
                  :filter-option="filterOption"
                  show-search
                >
                  <a-select-option
                    :value="item.value"
                    :title="item.label"
                    v-for="item in refundStatus"
                    >{{ item.label }}</a-select-option
                  >
                </a-select>
              </a-form-item>
              <a-form-item label="订单状态" name="orderStatus">
                <a-select
                  v-model:value="form.refundStatus"
                  style="width: 240px"
                  :filter-option="filterOption"
                  show-search
                >
                  <a-select-option
                    :value="item.value"
                    :title="item.label"
                    v-for="item in orderStatus"
                    >{{ item.label }}</a-select-option
                  >
                </a-select>
              </a-form-item>
              <a-form-item label="退款类型" name="refundType">
                <a-select v-model:value="form.refundType" style="width: 240px">
                  <a-select-option :value="1">退货退款</a-select-option>
                  <a-select-option :value="2">仅退款</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
            <a-col :span="12">
              <a-form-item label="商品状态" name="productStatus">
                <a-select
                  v-model:value="form.productStatus"
                  style="width: 240px"
                >
                  <a-select-option :value="1">已破损</a-select-option>
                  <a-select-option :value="2">未破损</a-select-option>
                </a-select>
              </a-form-item>
              <a-form-item label="提交类型" name="submitType">
                <a-input v-model:value="form.submitType" />
              </a-form-item>
              <a-form-item label="问题描述" name="problemDescription">
                <a-input v-model:value="form.problemDescription" />
              </a-form-item>
              <a-form-item label="图片信息" name="img">
                <a-image :src="form.img" v-if="form.img" :width="50" />
              </a-form-item>
              <a-form-item label="审核人名称" name="applyUserName">
                <a-input v-model:value="form.applyUserName" />
              </a-form-item>
              <a-form-item label="审核时间" name="applyTime">
                <a-input v-model:value="form.applyTime" />
              </a-form-item>
              <a-form-item label="审核备注" name="applyRemark">
                <a-input v-model:value="form.applyRemark" />
              </a-form-item>
              <a-form-item label="附件" name="attachment">
                <a
                  :href="form.attachment"
                  v-if="form.attachment"
                  target="_blank"
                  >点击查看</a
                >
              </a-form-item>
              <a-form-item label="提交时间" name="createdTime">
                <a-input v-model:value="form.createdTime" />
              </a-form-item>
              <a-form-item label="退款方式" name="refundWay">
                <a-select v-model:value="form.refundWay" style="width: 240px">
                  <a-select-option :value="1">原支付方式返回</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
          </a-row>
        </a-form>
        <a-divider />
        <div style="font-size: 18px; font-weight: 700; margin: 10px 0px">
          商品信息
        </div>
        <div v-global-loading="modalloading">
          <a-form
            :model="orderRefundProducts"
            ref="formRef"
            :labelCol="{span: 8}"
          >
            <a-row :gutter="24">
              <a-col :span="12">
                <a-form-item label="退款金额" name="refundAmount">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].refundAmount
                    "
                  />
                </a-form-item>
                <a-form-item label="退款数量" name="refundNum">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].refundNum
                    "
                  />
                </a-form-item>
                <a-form-item label="商品图片" name="productImg">
                  <a-image
                    :src="orderRefundProducts[commodityIndex].img"
                    :width="80"
                  ></a-image>
                </a-form-item>
                <a-form-item label="商品编号" name="productCode">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].productCode
                    "
                  />
                </a-form-item>
                <a-form-item label="商品名称" name="productName">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].productName
                    "
                  />
                </a-form-item>
                <a-form-item label="商品规格" name="productSpec">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].productSpec
                    "
                  />
                </a-form-item>
                <a-form-item label="支付总金额" name="payAmount">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].payAmount
                    "
                  />
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="下单数量" name="num">
                  <a-input
                    v-model:value="orderRefundProducts[commodityIndex].num"
                  />
                </a-form-item>
                <a-form-item label="单价" name="price">
                  <a-input
                    v-model:value="orderRefundProducts[commodityIndex].price"
                  />
                </a-form-item>
                <a-form-item label="总金额" name="amount">
                  <a-input
                    v-model:value="orderRefundProducts[commodityIndex].amount"
                  />
                </a-form-item>
                <a-form-item label="税额" name="tax">
                  <a-input
                    v-model:value="orderRefundProducts[commodityIndex].tax"
                  />
                </a-form-item>
                <a-form-item label="会员单价" name="memberPrice">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].memberPrice
                    "
                  />
                </a-form-item>
                <a-form-item label="优惠总金额" name="discountAmount">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].discountAmount
                    "
                  />
                </a-form-item>
                <a-form-item label="商品参数" name="productSkuValues">
                  <span
                    @click="
                      operationSku(
                        orderRefundProducts[commodityIndex].productSkuValues
                      )
                    "
                    class="pointer c-primaryColor"
                    >点击查看商品参数</span
                  >
                </a-form-item>
                <a-form-item label="商品单位" name="productUnit">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].productUnit
                    "
                  />
                </a-form-item>
              </a-col>
            </a-row>
          </a-form>
          <div style="display: flex; justify-content: end">
            <a-pagination
              v-model:current="current"
              simple
              v-model:page-size="pageSize1"
              :total="orderRefundProducts.length"
              @change="changePage"
            />
          </div>
        </div>
      </a-modal>
      <!-- 审核 -->
      <a-modal
        v-model:open="visible1"
        width="600px"
        title="审核信息"
        :footer="null"
        :maskClosable="false"
        @cancel="submit(2)"
      >
        <div v-global-loading="modalloading">
          <a-form :model="auditForm" ref="auditRef" :labelCol="{span: 9}">
            <a-row :gutter="24">
              <a-col :span="12">
                <a-form-item
                  label="审核意见"
                  name="auditResult"
                  :rules="[{required: true, message: '请填写'}]"
                >
                  <a-radio-group
                    v-model:value="auditForm.auditResult"
                    name="radioGroup"
                  >
                    <a-radio :value="true">通过</a-radio>
                    <a-radio :value="false">驳回</a-radio>
                  </a-radio-group>
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="附件上传" name="attachment">
                  <a
                    :href="auditForm.attachment"
                    target="_blank"
                    v-if="auditForm.attachment"
                    >查看附件</a
                  >
                  <div
                    class="commonBtn-primary"
                    @click="upload"
                    style="margin-left: 10px"
                  >
                    点击上传
                  </div>
                </a-form-item>
              </a-col>
            </a-row>
            <a-form-item
              label="审核备注"
              name="applyRemark"
              :labelCol="{span: 4}"
            >
              <a-input v-model:value="auditForm.applyRemark" />
            </a-form-item>
          </a-form>
          <div style="display: flex; justify-content: end; margin-top: 10px">
            <a-button style="margin-right: 10px" @click="submit(2)"
              >取消</a-button
            >
            <a-button type="primary" @click="submit(1)">确定</a-button>
          </div>
        </div>
      </a-modal>
      <!-- 商品详情 -->
      <a-modal
        v-model:open="visible2"
        width="800px"
        title="售后商品详情"
        :footer="null"
        :maskClosable="false"
      >
        <div v-global-loading="modalloading">
          <a-form
            :model="orderRefundProducts"
            ref="formRef"
            :labelCol="{span: 8}"
          >
            <a-row :gutter="24">
              <a-col :span="12">
                <a-form-item label="退款金额" name="refundAmount">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].refundAmount
                    "
                  />
                </a-form-item>
                <a-form-item label="退款数量" name="refundNum">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].refundNum
                    "
                  />
                </a-form-item>
                <a-form-item label="商品图片" name="productImg">
                  <a-image
                    :src="orderRefundProducts[commodityIndex].img"
                    :width="80"
                  ></a-image>
                </a-form-item>
                <a-form-item label="商品编号" name="productCode">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].productCode
                    "
                  />
                </a-form-item>
                <a-form-item label="商品名称" name="productName">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].productName
                    "
                  />
                </a-form-item>
                <a-form-item label="商品规格" name="productSpec">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].productSpec
                    "
                  />
                </a-form-item>
                <a-form-item label="支付总金额" name="payAmount">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].payAmount
                    "
                  />
                </a-form-item>
              </a-col>
              <a-col :span="12">
                <a-form-item label="下单数量" name="num">
                  <a-input
                    v-model:value="orderRefundProducts[commodityIndex].num"
                  />
                </a-form-item>
                <a-form-item label="单价" name="price">
                  <a-input
                    v-model:value="orderRefundProducts[commodityIndex].price"
                  />
                </a-form-item>
                <a-form-item label="总金额" name="amount">
                  <a-input
                    v-model:value="orderRefundProducts[commodityIndex].amount"
                  />
                </a-form-item>
                <a-form-item label="税额" name="tax">
                  <a-input
                    v-model:value="orderRefundProducts[commodityIndex].tax"
                  />
                </a-form-item>
                <a-form-item label="会员单价" name="memberPrice">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].memberPrice
                    "
                  />
                </a-form-item>
                <a-form-item label="优惠总金额" name="discountAmount">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].discountAmount
                    "
                  />
                </a-form-item>
                <a-form-item label="商品参数" name="productSkuValues">
                  <span
                    @click="
                      operationSku(
                        orderRefundProducts[commodityIndex].productSkuValues
                      )
                    "
                    class="pointer c-primaryColor"
                    >点击查看商品参数</span
                  >
                </a-form-item>
                <a-form-item label="商品单位" name="productUnit">
                  <a-input
                    v-model:value="
                      orderRefundProducts[commodityIndex].productUnit
                    "
                  />
                </a-form-item>
              </a-col>
            </a-row>
          </a-form>
          <div style="display: flex; justify-content: end">
            <a-pagination
              v-model:current="current"
              simple
              v-model:page-size="pageSize1"
              :total="orderRefundProducts.length"
              @change="changePage"
            />
          </div>
        </div>
      </a-modal>
      <!-- 商品SkU -->
      <a-modal
        v-model:open="visible3"
        width="600px"
        :zIndex="1013"
        title="商品参数"
        :footer="null"
        :maskClosable="false"
      >
        <a-table
          size="small"
          :dataSource="tableDataSku"
          :columns="columnsSku"
          bordered
          :pagination="false"
        >
          <template #bodyCell="{index, text, record, column}"> </template>
        </a-table>
      </a-modal>
    </div>
  </div>
</template>

<script lang="ts" setup>
import {ref, inject, onActivated, onMounted} from "vue";
import Pagination from "@/components/pagination/Pagination.vue";
import useAppStore from "@/store/app";
import {exportExcel} from "@/utils/exportFile";
import {trigerUpload, trigerUploadObs} from "@/utils/common";
import {message, Modal} from "ant-design-vue";
import {
  orderRefundPage,
  orderRefundList,
  orderRefundAuditRefundOrder,
  orderRefundDetail
} from "@/api/afterSales/afterSalesApply";
const filterOption = (input: string, option: any) => {
  return option.title.toLowerCase().indexOf(input.toLowerCase()) >= 0;
};
const tableData = ref<Array<object>>([]);
const tableDataSku = ref<Array<object>>([]);
const calcCanUseHeight: any = inject("calcCanUseHeight");
const visibleImg = ref<any>([]);

const setVisible = (flag, index) => {
  visibleImg.value[index] = flag;
};
onActivated(() => {
  calcCanUseHeight();
});
onMounted(() => {
  calcCanUseHeight();
});
//审核提交数据
const auditForm = ref<any>();
const auditRef = ref();
//商品详情集合
const orderRefundProducts = ref<any>([]);
const current = ref(1);
const commodityIndex = ref(0);
const pageSize1 = ref(1);
//商品分页展示
const modalloading = ref(false);
const changePage = (page) => {
  modalloading.value = true;
  setTimeout(() => {
    modalloading.value = false;
  }, 500);
  commodityIndex.value = page - 1;
};
const tableLoading = ref<boolean>(false);
const loading = ref<boolean>(false);
const visible = ref(false);
const visible1 = ref(false);
const visible2 = ref(false);
const visible3 = ref(false);
const form = ref<any>({});
const pageSet = ref<any>({
  pageNo: 1,
  pageSize: 20,
  total: 0,
  refundStatus: 7
});
//提交审核
const submit = (type) => {
  if (type == 1) {
    auditRef.value.validate().then(() => {
      modalloading.value = true;
      orderRefundAuditRefundOrder(auditForm.value)
        .then((res) => {
          message.success("审核成功");
          visible1.value = false;
          loadPagination(true);
        })
        .finally(() => {
          modalloading.value = false;
        });
    });
  } else {
    visible1.value = false;
    auditRef.value.clearValidate();
  }
};
//查看商品Sku
const operationSku = (data) => {
  tableDataSku.value = JSON.parse(data);
  visible3.value = true;
};
//操作
const operation = (type: number, data: any) => {
  if (type == 1) {
    //查看
    loading.value = true;
    orderRefundDetail({id: data.id})
      .then((res) => {
        commodityIndex.value = 0;
        form.value = res.data;
        if (form.value.applyTime == "1900-01-01 00:00:00") {
          form.value.applyTime = null;
        }
        form.value.num = 0;
        form.value.refundAmount = 0;
        orderRefundProducts.value = res.data.orderRefundProducts || [];
        orderRefundProducts.value.forEach((item) => {
          form.value.num += item.refundNum;
          form.value.refundAmount += item.refundAmount;
          item.productImg = JSON.parse(item.productImg) || [];
          if (item.productImg.length) {
            item.img = item.productImg[0].ImgUrl;
          }
        });
        visible.value = true;
      })
      .finally(() => {
        loading.value = false;
      });
  } else if (type == 2) {
    //审核
    visible1.value = true;
    auditForm.value = {id: data.id};
  } else if (type == 3) {
    //查看商品详情
    loading.value = true;
    orderRefundDetail({id: data.id})
      .then((res) => {
        form.value = res.data;
        commodityIndex.value = 0;
        orderRefundProducts.value = res.data.orderRefundProducts || [];
        orderRefundProducts.value.forEach((item) => {
          item.productImg = JSON.parse(item.productImg) || [];
          if (item.productImg.length) {
            item.img = item.productImg[0].ImgUrl;
          }
        });
        visible2.value = true;
      })
      .finally(() => {
        loading.value = false;
      });
  }
};
const changeTab = () => {
  pageSet.value = {
    pageNo: 1,
    pageSize: 20,
    total: 0,
    refundStatus: pageSet.value.refundStatus
  };
  loadPagination(true);
};
//获取数据
const loadPagination = (flag: boolean = false): void => {
  if (flag) {
    pageSet.value.pageNo = 1;
  }
  tableLoading.value = true;
  orderRefundPage(pageSet.value)
    .then((res) => {
      tableData.value = res.data.rows;
      pageSet.value.total = res.data.totalRows;
    })
    .finally(() => {
      tableLoading.value = false;
    });
};
//重置
const reset = (): void => {
  pageSet.value = {
    pageNo: 1,
    pageSize: 20,
    total: 0,
    refundStatus: pageSet.value.refundStatus
  };
  loadPagination(true);
};
loadPagination(true);
//导出
const exportDerive = (): void => {
  let tableExport = JSON.parse(JSON.stringify(tableData.value));
  tableExport.forEach((item) => {
    if (item.refundWay == 1) {
      item.refundWay = "原支付方式返回";
    }

    if (item.refundType == 1) {
      item.refundType = "退货退款";
    } else if (item.refundType == 2) {
      item.refundType = "仅退款";
    }

    if (item.productStatus == 1) {
      item.productStatus = "已破损";
    } else if (item.productStatus == 2) {
      item.productStatus = "未破损";
    }

    let name = "";
    for (let i = 0; i < orderStatus.value.length; i++) {
      if (orderStatus.value[i].value == item.orderStatus) {
        name = orderStatus.value[i].label;
        break;
      }
    }
    item.orderStatus = name;
  });
  exportExcel(columns.value, tableExport, "售后订单列表");
};
const columns = ref<Array<object>>([
  {
    title: "序号",
    dataIndex: "name",
    align: "center",
    width: 50,
    customRender: ({index}) => {
      return index + 1;
    },
    fixed: "left"
  },
  {
    title: "退款订单编号",
    dataIndex: "refundCodeSN",
    align: "center",
    width: 200
  },
  {
    title: "用户名",
    dataIndex: "createdUserName",
    align: "center",
    width: 120
  },
  {
    title: "订单总金额",
    dataIndex: "amount",
    align: "center",
    width: 120
  },
  {
    title: "税额",
    dataIndex: "tax",
    align: "center",
    width: 120
  },
  {
    title: "订单优惠金额",
    dataIndex: "discountAmount",
    align: "center",
    width: 120
  },
  {
    title: "退款方式",
    dataIndex: "refundWay",
    align: "center",
    width: 120,
    customRender: ({value}) => {
      if (value == 1) {
        return "原支付方式返回";
      } else {
        return "";
      }
    }
  },
  {
    title: "退款类型",
    dataIndex: "refundType",
    align: "center",
    width: 200,
    customRender: ({value}) => {
      if (value == 1) {
        return "退货退款";
      } else if (value == 2) {
        return "仅退款";
      } else {
        return "";
      }
    }
  },
  {
    title: "订单状态",
    dataIndex: "orderStatus",
    align: "center",
    width: 180,
    customRender: ({value}) => {
      let name = "";
      for (let i = 0; i < orderStatus.value.length; i++) {
        if (orderStatus.value[i].value == value) {
          name = orderStatus.value[i].label;
          break;
        }
      }
      return name;
    }
  },
  {
    title: "商品状态",
    dataIndex: "productStatus",
    align: "center",
    width: 180,
    customRender: ({value}) => {
      return value == 1 ? "已破损" : "未破损";
    }
  },
  {
    title: "申请时间",
    dataIndex: "createdTime",
    align: "center",
    width: 180
  },
  {
    title: "提交类型",
    dataIndex: "submitType",
    align: "center",
    width: 180
  },
  // {
  //   title: "图片信息",
  //   dataIndex: "img",
  //   align: "center",
  //   width: 120
  // },
  {
    title: "问题描述",
    dataIndex: "problemDescription",
    align: "center",
    width: 120
  },
  {
    title: "操作",
    dataIndex: "l",
    align: "center",
    width: 200,
    fixed: "right"
  }
]);
const columnsSku = ref<Array<object>>([
  {
    title: "序号",
    dataIndex: "sort",
    align: "center",
    width: 50,
    customRender: ({index}) => {
      return index + 1;
    }
  },
  {
    title: "属性名称",
    dataIndex: "ParamName",
    align: "center",
    width: 180
  },
  {
    title: "属性值",
    dataIndex: "ParamValue",
    align: "center",
    width: 180
  }
]);
function changePicker(a, b) {
  if (a) {
    pageSet.value.beginTime = b[0];
    pageSet.value.endTime = b[1];
  } else {
    pageSet.value.beginTime = null;
    pageSet.value.endTime = null;
  }
}
const upload = () => {
  trigerUpload().then((res: any) => {
    modalloading.value = true;
    trigerUploadObs(res)
      .then((data) => {
        auditForm.value.attachment = data;
      })
      .finally(() => {
        modalloading.value = false;
      });
  });
};
//售后状态
const refundStatus = ref([
  {label: "审核中", value: 7},
  {label: "审核通过", value: 8},
  {label: "已关闭", value: 9},
  {label: "审核驳回", value: 11}
]);
//订单状态
const orderStatus = ref([
  {label: "已提交", value: 0},
  {label: "待支付订单", value: 1},
  {label: "待审核订单", value: 2},
  {label: "待发货订单", value: 3},
  {label: "待收货订单", value: 4},
  {label: "待评价订单", value: 5},
  {label: "交易成功", value: 6},
  {label: "售后中", value: 7},
  {label: "售后完成", value: 8},
  {label: "售后关闭", value: 9},
  {label: "交易关闭", value: 10}
]);
</script>

<style lang="less" scoped></style>
